-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support extra-verbose builds #48943
Support extra-verbose builds #48943
Conversation
Highfive failed to assign a reviewer. |
r=me after fixing tidy:
|
src/bootstrap/bootstrap.py
Outdated
@@ -597,10 +597,8 @@ def build_bootstrap(self): | |||
self.cargo())) | |||
args = [self.cargo(), "build", "--manifest-path", | |||
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] | |||
if self.verbose: | |||
for _ in range(0, max(0, self.verbose - 1)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both Python 2 and 3, range(0, self.verbose - 1)
will be empty when self.verbose - 1
is zero or negative, so the max(0, _)
is unnecessary.
src/bootstrap/flags.rs
Outdated
@@ -29,7 +29,7 @@ use cache::{Interned, INTERNER}; | |||
|
|||
/// Deserialized version of all flags for this compile. | |||
pub struct Flags { | |||
pub verbose: usize, // verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose | |||
pub verbose: usize, // verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == omg so verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
(This line is >100 chars BTW)
src/bootstrap/lib.rs
Outdated
pub fn is_very_verbose(&self) -> bool { | ||
self.verbosity > 1 | ||
pub fn cargo_verbosity_level(&self) -> usize { | ||
if self.verbosity == 0 { 0 } else { self.verbosity - 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simply self.verbosity.saturating_sub(1)
Alternatively you could use this in src/bootstrap/builder.rs
to entirely get rid of this function.
// if rustbuild is invoked with N `-v`s, we pass N-1 `-v`s to cargo.
for _ in 1..self.verbosity {
cargo.arg("-v");
}
- The bootstrap crate currently passes -v to Cargo if itself invoked with -vv. But Cargo supports -vv (to show build script output), so make bootstrap pass that if itself invoked with -vvv. (More specifically, pass N '-v's to Cargo if invoked with N+1 of them.) - bootstrap.py currently tries to pass on up to two '-v's to cargo when building bootstrap, but incorrectly ('-v' is marked as 'store_true', so argparse stores either False or True, ignoring multiple '-v's). Fix this, allow passing any number of '-v's, and make it consistent with bootstrap's invocation of Cargo (i.e. subtract one from the number of '-v's). - Also improve bootstrap.py's config.toml 'parsing' to support arbitrary verbosity levels, + allow command line to override it.
Updated in light of review comments. |
r? @kennytm |
@bors r+ |
📌 Commit ec49234 has been approved by |
@bors: rollup |
Support extra-verbose builds - The bootstrap crate currently passes -v to Cargo if itself invoked with -vv. But Cargo supports -vv (to show build script output), so make bootstrap pass that if itself invoked with -vvv. (More specifically, pass N '-v's to Cargo if invoked with N+1 of them.) - bootstrap.py currently tries to pass on up to two '-v's to cargo when building bootstrap, but incorrectly ('-v' is marked as 'store_true', so argparse stores either False or True, ignoring multiple '-v's). Fix this, allow passing any number of '-v's, and make it consistent with bootstrap's invocation of Cargo (i.e. subtract one from the number of '-v's). - Also improve bootstrap.py's config.toml 'parsing' to support arbitrary verbosity levels, + allow command line to override it.
The bootstrap crate currently passes -v to Cargo if itself invoked with -vv. But Cargo supports -vv (to show build script output), so make bootstrap pass that if itself invoked with -vvv. (More specifically, pass N '-v's to Cargo if invoked with N+1 of them.)
bootstrap.py currently tries to pass on up to two '-v's to cargo when building bootstrap, but incorrectly ('-v' is marked as 'store_true', so argparse stores either False or True, ignoring multiple '-v's). Fix this, allow passing any number of '-v's, and make it consistent with bootstrap's invocation of Cargo (i.e. subtract one from the number of '-v's).
Also improve bootstrap.py's config.toml 'parsing' to support arbitrary verbosity levels, + allow command line to override it.